import http from '@/utils/request'

const options = {
  ignoreCancelToken: false
}


const API_PREFIX = '/web/reports'

export const fetcDatasetData = ({ id, ...params }) =>
  http.get(`${API_PREFIX}/sys/dataset/${id}/data`, { params })

export const fetcDatasetList = (params) =>
  http.post(`${API_PREFIX}/sys/dataset/card-list`, params)

export const fetchDatasetGrid = params => http.get(`${API_PREFIX}/sys/dataset/grid-list`, {
  params
}, options)

export const fetchLinkedWidgets = params => http.get(`${API_PREFIX}/model-dataset-rel/list-model-by-dataset`, {
  params
})
export const deleteLinkedWidget = params => http.delete(`${API_PREFIX}/model-dataset-rel/delete-model-report`, {
  params
})